/*package main;
import java.util.Observable;

public class HeadOfLaboratory extends Observable {

	
	private String Name;
	private String Spec;
	private int Scientists;
	private LabExecutor exec;
	
	public HeadOfLaboratory(String name,String spec,int scientists)
	{
		Name = new String (name);
		Spec = new String (spec);
		Scientists=scientists;
		exec = new LabExecutor(scientists);
		
	}
	public String getName() {
		return new String(Name);
	}
	public String getSpec() {
		return new String(Spec);
	}
	public int getScientists() {
		return Scientists;
	}
	public boolean ExperimentComplete(RunnableExperiment exp) {
		
		exec.freeScientist();
		this.notifyObservers(exp);
		return true;
		
	}
	public void runExpirement(RunnableExperiment rexp) {
		exec.execute(rexp);
		
	}
	public void shutdown() {
		exec.shutdown();
		
	}

	}
*/


package main;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class HeadOfLaboratory {

	
	private String Name;
	private String Spec;
	private int Scientists;
	private ExecutorService exec;
	
	public HeadOfLaboratory(String name,String spec,int scientists)
	{
		Name = new String (name);
		Spec = new String (spec);
		Scientists=scientists;
		exec = Executors.newFixedThreadPool(scientists);
		
	}
	public String getName() {
		return new String(Name);
	}
	public String getSpec() {
		return new String(Spec);
	}
	public int getScientists() {
		return Scientists;
	}
	
	public void runExpirement(RunnableExperiment rexp) {
		exec.execute(rexp);
		
	}
	public synchronized void shutdown() {
		exec.shutdown();
		
	}

	}



